package com.ruoyi.controller;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.domain.Comment;
import com.ruoyi.service.ICommentService;

/**
 * 评论Controller
 *
 * @author qyb
 * @date 2023-12-26
 */
@RestController
@RequestMapping("/user/comment")
public class CommentController extends BaseController
{
    @Resource
    private ICommentService commentService;



    @GetMapping("getCommentList")
    public AjaxResult getCommentList(Comment comment1){
//        return AjaxResult.success(comment.getCommentsByBookId(comment1.getBookId()));
//        return AjaxResult.success(commentService.getCommentsByBookId(comment1.getBookId())) ;
        return null;
    }

    @GetMapping("getCommentsById")
    public AjaxResult getCommentsById( @RequestBody Comment comment){
        return commentService.comment(comment.getBookId());
    }


}
